package com.woniuedu.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuedu.dao.ManageCourseMapper;
import com.woniuedu.dto.ManageCourseDto;
import com.woniuedu.entity.Course;
import com.woniuedu.service.ManageCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * author: 承雍
 * Date: 2022/4/27 9:59
 * Description:
 */
@Service
public class ManageCourseServiceImpl extends ServiceImpl<ManageCourseMapper, Course> implements ManageCourseService {
    @Autowired(required = false)
    ManageCourseMapper manageCourseMapper;

    @Override
    public IPage<Course> findAllCourse(ManageCourseDto manageCourseDto) {
        IPage<Course> iPage=new Page<>(manageCourseDto.getCurrentPage(), manageCourseDto.getPageSize());
        return manageCourseMapper.findAllCourse(iPage,manageCourseDto.getCourseName(),manageCourseDto.getCourseStatus());
    }
}
